Groups the elements of a view according to a specified key selector function
and creates a result value from each group and its key.
The elements of each group are projected by using a specified function.
Namespace:
C1.LiveLinq.LiveViewsAssembly: C1.LiveLinq (in C1.LiveLinq.dll)
Syntax
C# |
---|
public View<TResult> GroupBy<TKey, TElement, TResult>( Expression<Func<T, TKey>> keySelector, Expression<Func<T, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector ) |
Visual Basic |
---|
Public Function GroupBy(Of TKey, TElement, TResult) ( _ keySelector As Expression(Of Func(Of T, TKey)), _ elementSelector As Expression(Of Func(Of T, TElement)), _ resultSelector As Expression(Of Func(Of TKey, IEnumerable(Of TElement), TResult)) _ ) As View(Of TResult) |
Parameters
- keySelector
- Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'T, TKey>)>)>>)>)>
A function to extract the key for each element.
- elementSelector
- Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'T, TElement>)>)>>)>)>
A function to map each source element to an element in the IGrouping<(Of <(<'TKey, TElement>)>)>.
- resultSelector
- Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'TKey, IEnumerable<(Of <(<'TElement>)>)>, TResult>)>)>>)>)>
A function to create a result value from each group.
Type Parameters
- TKey
- The type of the key returned by keySelector.
- TElement
- The type of the elements in groups.
- TResult
- The type of the result value returned by resultSelector.